jQuery(function($) {

	streamers = [];
	LIBREANTENE = "";
	IP = "";
	INVITE = "";

	$('#form-link').on('submit', function(){
		var before = $("#before-link").val();
		var name = $("#name-link").val();
		var url = $("#url-link").val();

		var html = before + " <a style=\"font-weight: bold; line-height: 20px; color: #0000FF; display: inline;\" href=\""+url +"\" id=\"istw\" target=\"_blank\">"+name+"</a>" 

		$('#link-code').val(html);
		$('#link-preview').html(html);
		return false;
	});


	var removeElements = function(text, selector) {
		var wrapped = $("<div>" + text + "</div>");
		wrapped.find(selector).remove();
		return wrapped.html();
	}

	function replaceTemplate(html,old,nw){
	//	console.log('rplace : ' + old + " => " + nw );
	h = html.replace(old, nw);
	return h;	
}



function getStreamerByName(name){

	for(id in streamers){
		s = streamers[id];
		if(name === s.name){
			return s;
		}
	}

	return null;
}
});